﻿@page "/register"
@layout MainLayout
@attribute [AllowAnonymous]

<EditForm OnValidSubmit="OnSubmit" Model="RegisterViewModelSubmit">
    <DataAnnotationsValidator />
    <MudGrid>
        @*<MudItem xs="12">
            <div class="d-flex justify-center">
            <MudIcon Icon="@CustomIcons.BlazorHero" Color="Color.Primary" Size="Size.Large" ViewBox="0 0 500 500" Style="width: 100px; height: 100px;" />
            </div>
            </MudItem>*@
        <MudItem xs="12">
            <div class="d-flex justify-center">
                <MudText Typo="Typo.h4">@DashboardResource.StringRegister</MudText>
            </div>
        </MudItem>
        <MudItem xs="12">
            <div class="d-flex justify-center">
                <MudText>
                    @DashboardResource.StringAlreadyAccount
                    <MudLink Href="/login">
                        @DashboardResource.StringSignin
                    </MudLink>
                </MudText>
            </div>
        </MudItem>
        <MudItem xs="12">
            <MudTextField For="@(() => RegisterViewModelSubmit.UserName)" @bind-Value="RegisterViewModelSubmit.UserName"
                Label="@DashboardResource.StringUserName" />
        </MudItem>
        <MudItem xs="12" sm="6" md="6">
            <MudTextField For="@(() => RegisterViewModelSubmit.Password)" InputType="@_passwordInput" 
                Adornment="Adornment.End" AdornmentIcon="@_passwordInputIcon" OnAdornmentClick="TogglePasswordVisibility" 
                @bind-Value="RegisterViewModelSubmit.Password" Label="@DashboardResource.StringPassword" />
        </MudItem>
        <MudItem xs="12" sm="6" md="6">
            <MudTextField For="@(() => RegisterViewModelSubmit.ConfirmPassword)" InputType="InputType.Password" 
                @bind-Value="RegisterViewModelSubmit.ConfirmPassword" 
                Label="@DashboardResource.StringConfirmPassword" />
        </MudItem>
        <MudItem xs="12">
            <MudTextField For="@(() => RegisterViewModelSubmit.PersonalCode)" 
                @bind-Value="RegisterViewModelSubmit.PersonalCode"
                Label="@DashboardResource.StringPersonalCode" />
        </MudItem>
        <MudItem xs="12" Class="d-flex justify-space-between align-center">
            <MudCheckBox For="@(() => RegisterViewModelSubmit.IsTermsService)"
                         @bind-Value="RegisterViewModelSubmit.IsTermsService" Label="@DashboardResource.StringAcceptTerms"
                         Color="Color.Primary" Class="ml-n1"></MudCheckBox>
        </MudItem>
        <MudItem xs="12" Class="d-flex justify-center">
            <MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary" Size="Size.Large" Style="width: 100%;">
                @DashboardResource.StringRegister
            </MudButton>
        </MudItem>
    </MudGrid>

</EditForm>
